// 判断本地存储中是否有useInfo这个字段，如果有就return true,没有就return false
import {useState} from "react"
export default function(initialState:object){
    let [useInfo,setInfo] = useState(initialState)
    let isLogin = JSON.parse(localStorage.getItem("useInfo")||"{}")
    function setUseInfo(newState:object){
        setInfo(newState)
    }
    return[isLogin,setUseInfo]
}